<#-- 导入模版定义文件-->
<#include "../template/template_editPage.ftl">
<@edit title="商品信息管理">
    <#if (trader.traderId)??>
        <#assign isEdit = true />
    <#else>
        <#assign isAdd = true />
    </#if>
<body class="input">

<script type="text/javascript">
    $().ready(function () {

        var $validateErrorContainer = $("#validateErrorContainer");
        var $validateErrorLabelContainer = $("#validateErrorContainer ul");
        var $validateForm = $("#inputForm");
        var $tab = $("#tab");

        // Tab效果
        $tab.tabs(".tabContent", {
            tabs:"input"
        });

        // 表单验证
        $validateForm.validate({
            errorContainer:$validateErrorContainer,
            errorLabelContainer:$validateErrorLabelContainer,
            wrapper:"li",
            errorClass:"validateError",
            ignoreTitle:true,
            rules:{
                "commissionPay.money":{
                    required:true
                }
            },
            messages:{
                "commissionPay.money":{
                    required:"返佣金额不能为空！"
                }
            },
            submitHandler:function (form) {
                //$(form).find(":submit").attr("disabled", true);
                form.submit();
            }
        });
        <#if actionErrors?? && (actionErrors?size > 0)>
            $.messager.show("提示信息", "<#list errorMessages as list>${list}<br></#list>", 2000);
        </#if>
    });
    var res = true ;
    var checkuse = true ;
    var checktrader = true ;
    function checkPrice() {
        $("#priceSpan").html('');
        var e = /^(([1-9]\d*)|\d)(\.\d{1,3})?$/;
        var blsx = $("#commonSalePrice").val();
        if (!e.test(blsx)) {
            $("#priceSpan").html('价格格式不正确！(例：0.000)');
            return false;
        }
        else {
            return true;
        }
    }
function commission(){
	if($.trim($("#money").val()) == ''){
		alert('返佣金额不能为空！') ;
		res = false ;
		return ;
	}
	var param = $('#inputForm').serialize() ;
	$.post(
		'${web_base}/ekhui/account!commissionComplete.htm' ,
		param ,
		function(data){
			alert(data) ;
			window.location.href = "${web_base}/ekhui/account!list.htm" ;
		}
	);
}
</script>

<div class="body">
<div class="inputBar">
    <h1><span class="icon">&nbsp;</span>返还佣金</h1>
</div>
<div style="display: none;" id="validateErrorContainer" class="validateErrorContainer">
    <div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
    <ul></ul>
</div>
<form id="inputForm" class="validate"
      method="post">
      <input type="hidden" name="account.accountId" value="${account.accountId}">
      <ul class="tab">
        <li>
            <input type="button" value="返还佣金" hidefocus="true"/>
        </li>
    </ul>
     <table class="inputTable tabContent">
        <tr>
            <th>
                返还佣金金额(元)：
            </th>
            <td>
                   <input type="text" id="money" name="commissionPay.money" onblur="checkMoney()" 
                   class="formText {required: true}" value=""/>
                   <label class="requireField">*</label>
            </td>
        </tr>

     </table>   
    <div class="buttonArea">
        <input type="button" class="formButton" value="确定" onclick="commission()" />&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" class="formButton" onclick="window.history.back(); return false;" value="返  回"
               hidefocus="true"/>
    </div>
</form>
</div>
</body>
</@edit>
